home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 3760 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: news.umbc.edu!not-for-mail
  2. From: schlein@umbc.edu (Jonas J. Schlein)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Want function of strmp with wild characters
  5. Date: 30 Jan 1996 17:44:50 -0500
  6. Organization: University of Maryland Baltimore County
  7. Message-ID: <4em712$aed@rpc40.gl.umbc.edu>
  8. References: <1996Jan30.213213.16764@schbbs.mot.com>
  9. NNTP-Posting-Host: rpc40.gl.umbc.edu
  10. NNTP-Posting-User: schlein
  11.  
  12. Ashok Patil <ashokp@mmsilcc.NoSubdomain.NoDomain> wrote:
  13. |> I need a function that compares two strings with
  14. |> wild cards. like one string is "Hello" and another is
  15. |> is "Helo*". The comparison of these two should return
  16. |> 0. And if it works for ? that would be great.
  17.  
  18. Such a function is not a part of the ANSI C language. However, if
  19. something as simple as the first n characters of a word need to
  20. compare then I'd use strncmp() which is an ANSI C function located
  21. in <string.h>. For more complicated matching there are add on
  22. libraries for regular expression matching which I have seen floating
  23. around the net. I have not used them personally so please don't
  24. ask me where to get 'em.
  25. -- 
  26. "If it wasn't for C, we would be using BASI, PASAL, and OBOL."
  27.  
  28. Jonas J. Schlein  (schlein@gl.umbc.edu)
  29.